from flask import Blueprint
from flask_restful import Api

from common.utils.output import output_json
from financial.resource.user.user_resource import Register, SmsCode, Login, Logout

user_bp = Blueprint('user', __name__, url_prefix='/user')  # 创建蓝图
user_api = Api(user_bp)

# 使用定制好的返回到前端的json格式
user_api.representation('application/json')(output_json)

user_api.add_resource(Register, '/registe', endpoint='registe')  # 登录的资源
user_api.add_resource(SmsCode, '/smscode', endpoint='smscode')  # 发送验证码
user_api.add_resource(Login, '/login', endpoint='login')  # 用户登陆
user_api.add_resource(Logout, '/logout', endpoint='logout')  # 用户退出
